home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 8: LINUX Games
/
Linux Cubed Series 8 - LINUX Games.iso
/
games
/
x11
/
networke
/
civ-0.000
/
civ-0
/
civ-0.3
/
src
/
misc.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-16
|
454b
|
27 lines
#ifndef _MISC_H
#define _MISC_H
#include "mytypes.h"
#include "list.h"
#include <string.h>
class StrKey
{
public:
StrKey(char *ptr) { str = ptr; }
~StrKey() {}
int operator==(StrKey &key) { return strcmp(str, key.str) == 0; }
unsigned long HashValue() {
unsigned long hash = 0;
for (char *ptr = str; *ptr; ++ptr) hash = (hash<<1)^*ptr;
return hash;
}
char *str;
};
void AddMessage(List<charp> &l, char *format, ...);
#endif